﻿using AutoMapper;
using H2.NET.Business;
using H2.NET.Common;
using H2.NET.Data.Common;
using H2.NET.Web.Management.Config.Service;
using H2.NET.Web.Pages.SMD.Model;
using H2.NET.Web.Pages.SMD.Service;
using H2.NET.Web.Workflow.DwzCode;
using H2.NET.Web.Workflow.Models;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace H2.NET.Web.Pages.SMD
{
    public partial class StoreBatchApprove : BasePage
    {
        public string ids;

        protected void Page_Load(object sender, EventArgs e)
        {
            ids = AksRequest.GetString("ids");

            if (!IsPostBack)
            {
                DropDwonListBind();
            }
        }

        private void DropDwonListBind()
        {
            ConfigService configService = new ConfigService();

            #region 门店类型
            DataTable dt_area = configService.GetList("ParentId = (select configid from t_smd_Config where code='S_MDLX') order by seq").Tables[0];
            StoreType.AppendDataBoundItems = true;
            StoreType.Items.Add(new ListItem("==请选择==", ""));
            foreach (DataRow row in dt_area.Rows)
            {
                StoreType.Items.Add(new ListItem(row["Name"].ToString(), row["Value"].ToString()));
            }
            #endregion

            #region 门店区域
            DataTable dt_areaName = configService.GetList("ParentId = (select configid from t_smd_Config where code='M_MDQY') order by seq").Tables[0];
            AreaName.AppendDataBoundItems = true;
            AreaName.Items.Add(new ListItem("==请选择==", ""));
            foreach (DataRow row in dt_areaName.Rows)
            {
                AreaName.Items.Add(new ListItem(row["Name"].ToString(), row["Name"].ToString()));
            }
            #endregion

            #region 渠道
            DataTable dt_channel = configService.GetList("ParentId = (select configid from t_smd_Config where code='S_QD') order by seq").Tables[0];
            Channel.AppendDataBoundItems = true;
            Channel.Items.Add(new ListItem("==请选择==", ""));
            foreach (DataRow row in dt_channel.Rows)
            {
                Channel.Items.Add(new ListItem(row["Name"].ToString(), row["Name"].ToString()));
            }
            #endregion
        }
    }
}